package edu.qichen.onlineBlog.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import edu.qichen.onlineBlog.framework.DataResult;
import edu.qichen.onlineBlog.user.dto.*;
import edu.qichen.onlineBlog.user.pojo.User;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

/**
 * 功能:
 * 作者:程序员欧阳子韩
 * 日期:2024/3/27 17:08
 */
public interface UserService extends IService<User> {
    Boolean findByEmail(String email);

    List<User> queryUserInfo();

    UserLoginRes login(UserLoginReq user, HttpServletRequest request);

    UserLoginRes register(UserRegisterReq user, HttpServletRequest request);

    User updateUser(UserUpdateReq userUpdateReq, HttpServletRequest request);

    User addUser(UserAddReq userAddReq, HttpServletRequest request);

    Boolean updatePwd(UpdatePwdReq updatePwdReq, HttpServletRequest request);

    PageUserRes userPage(PageUserReq pageUserReq);

    Boolean deleteById(Long id, HttpServletRequest request);

    User validateTokenAndGetUser(String userId, String token);

    /**
     * 根据条件分页查询用户列表
     *
     * @param user 用户信息
     * @return 用户信息集合信息
     */
    List<UserExportDTO> selectUserList(UserExportDTO user,HttpServletRequest request);

    List<UserExportDTO> selectUserExportList(String username, String nickname, List<Integer> idsList);

    void insert(List<UserExportDTO> userExportDTOS);

    boolean findByUsername(String username);
}
